% function yy = cellProbCompare(PHat,benchmark1, benchmark2, benchmark3,R,C,SampleLength)
function yy = cellProbCompare(PHat,benchmark1, benchmark2, benchmark3,R,C,SampleLength, type, indicator)
yy = zeros (R,C,SampleLength,4);

for i = 1: R
    for j = 1: C
        if indicator == 0 % fitted
        yy(i,j,:,1) = PHat(type,:,i,j); 
        yy(i,j,:,2) = benchmark1(1:SampleLength,i,j);
        yy(i,j,:,3) = benchmark2(1:SampleLength,i,j);
        yy(i,j,:,4) = benchmark3(1:SampleLength,i,j);
        elseif indicator == 1 % fcst
        yy(i,j,:,1) = PHat(type,:,i,j); 
        yy(i,j,:,2) = benchmark1(48-SampleLength+1:48,i,j);
        yy(i,j,:,3) = benchmark2(48-SampleLength+1:48,i,j);
        yy(i,j,:,4) = benchmark3(48-SampleLength+1:48,i,j);
            
        end    
    end
end
end